

<%@ page import="baratopradedeu.Oferta" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'oferta.label', default: 'Oferta')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.nova.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${ofertaInstance}">
            <div class="errors">
                <g:renderErrors bean="${ofertaInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${ofertaInstance?.id}" />
                <g:hiddenField name="version" value="${ofertaInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="categoriaOferta"><g:message code="oferta.categoriaOferta.label" default="Categoria Oferta" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'categoriaOferta', 'errors')}">
                                    <g:select name="categoriaOferta.id" from="${baratopradedeu.CategoriaOferta.list()}" optionKey="id" value="${ofertaInstance?.categoriaOferta?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataFinal"><g:message code="oferta.dataFinal.label" default="Data Final" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'dataFinal', 'errors')}">
                                    <g:datePicker name="dataFinal" precision="day" value="${ofertaInstance?.dataFinal}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataInicial"><g:message code="oferta.dataInicial.label" default="Data Inicial" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'dataInicial', 'errors')}">
                                    <g:datePicker name="dataInicial" precision="day" value="${ofertaInstance?.dataInicial}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="destaque"><g:message code="oferta.destaque.label" default="Destaque" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'destaque', 'errors')}">
                                    <g:textField name="destaque" value="${ofertaInstance?.destaque}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="imagem"><g:message code="oferta.imagem.label" default="Imagem" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'imagem', 'errors')}">
                                    <g:textField name="imagem" value="${ofertaInstance?.imagem}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="parceiro"><g:message code="oferta.parceiro.label" default="Parceiro" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'parceiro', 'errors')}">
                                    <g:select name="parceiro.id" from="${baratopradedeu.Parceiro.list()}" optionKey="id" value="${ofertaInstance?.parceiro?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="qtdMax"><g:message code="oferta.qtdMax.label" default="Qtd Max" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'qtdMax', 'errors')}">
                                    <g:textField name="qtdMax" value="${fieldValue(bean: ofertaInstance, field: 'qtdMax')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="qtdMinima"><g:message code="oferta.qtdMinima.label" default="Qtd Minima" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'qtdMinima', 'errors')}">
                                    <g:textField name="qtdMinima" value="${fieldValue(bean: ofertaInstance, field: 'qtdMinima')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="regras"><g:message code="oferta.regras.label" default="Regras" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'regras', 'errors')}">
                                    <g:textField name="regras" value="${ofertaInstance?.regras}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="titulo"><g:message code="oferta.titulo.label" default="Titulo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'titulo', 'errors')}">
                                    <g:textField name="titulo" value="${ofertaInstance?.titulo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="valorDesconto"><g:message code="oferta.valorDesconto.label" default="Valor Desconto" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'valorDesconto', 'errors')}">
                                    <g:textField name="valorDesconto" value="${fieldValue(bean: ofertaInstance, field: 'valorDesconto')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="valorOriginal"><g:message code="oferta.valorOriginal.label" default="Valor Original" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ofertaInstance, field: 'valorOriginal', 'errors')}">
                                    <g:textField name="valorOriginal" value="${fieldValue(bean: ofertaInstance, field: 'valorOriginal')}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
